package chendu.feign;


import chendu.entity.PhoneInfo;
import chendu.entity.PhoneSpecs;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/*通过feign来管理微服务之间的调用*/
@FeignClient("service-phone")
public interface PhoneAPI {
    /*url:service-phone/findSpecsId*/
    @GetMapping(value = "/phone/findSpecsId")
    PhoneSpecs findSpecsById(@RequestParam("specsId") Integer specsId);

    /*url:service-phone/findPhoneId*/
    @GetMapping(value = "/phone/findPhoneId")
    PhoneInfo findPhoneById(@RequestParam("phoneId") Integer phoneId);

    @GetMapping(value = "/phone/findSpecsIdAnd")
    void subStock(@RequestParam("specsId")Integer specsId,@RequestParam("specsStock") Integer specsStock);
}